package com.fenghuajueli.module_user.dialog;

import android.app.Dialog;
import android.content.Context;
import android.os.Bundle;
import android.view.ViewGroup;
import android.view.WindowManager;

import com.blankj.utilcode.util.SizeUtils;
import com.fenghuajueli.module_user.databinding.DialogRefundTipBinding;
import com.fenghuajueli.module_user.ui.helpcenter.HelpContentActivity;

public class RefundTipDialog extends Dialog {

    public RefundTipDialog(Context context) {
        super(context, com.fenghuajueli.libbasecoreui.R.style.StyleBaseDialog);
    }

    private DialogRefundTipBinding binding;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        binding = DialogRefundTipBinding.inflate(getLayoutInflater());
        setContentView(binding.getRoot());

        WindowManager.LayoutParams attributes = getWindow().getAttributes();
        attributes.width = WindowManager.LayoutParams.MATCH_PARENT;
        attributes.height = WindowManager.LayoutParams.WRAP_CONTENT;

        ViewGroup.MarginLayoutParams layoutParams = (ViewGroup.MarginLayoutParams) binding.llContainer.getLayoutParams();
        int start = SizeUtils.dp2px(32);
        layoutParams.setMarginStart(start);
        layoutParams.setMarginEnd(start);
        binding.llContainer.setLayoutParams(layoutParams);
        binding.btnConfirm.setOnClickListener(v -> {
            HelpContentActivity.start(getContext(), "会员问题");
            dismiss();
        });
    }
}
